﻿using System;
using Nb.Common.Hardwares;

namespace Nb.Common.Aop
{
    //拦截组件
    /// <summary>
    /// 拦截组件（支持运行时替换）
    /// </summary>
    public class NbPerformanceTraceFacade
    {
        public static bool PerformanceTraceEnabled()
        {
            var service = NbPerformanceTraceServiceRegistry.Instance.GetService();
            var result = service.PerformanceTraceEnabled();
            return result;
        }
        public static int InterceptionSlowSpan()
        {
            var service = NbPerformanceTraceServiceRegistry.Instance.GetService();
            var result = service.InterceptionSlowSpan();
            return result;
        }
        public static bool ShouldIntercept(Type serviceType)
        {
            var service = NbPerformanceTraceServiceRegistry.Instance.GetService();
            var result = service.ShouldIntercept(serviceType);
            return result;
        }
    }


}
